package com.test.thread.consumer;

public class Producer extends Thread {
	private Q q;

	public Producer(Q q) {
		this.q = q;
		this.start();
	}

	public void run() {
		int i = 0;
		while (true) {
			q.put(i++);
			try {
				sleep(1000);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
	}

}
